export default class Binder {

  constructor() {
    this.fns = {};
  }

  /**
   * bind函数
   * @param fn
   * @param context
   * @param param
   * @returns {*}
   */
  bind(fn, context, param,id) {
    if (this.fns[id]) {
      return this.fns[id];
    } else {
      fn = fn.bind(context, param);
      this.fns[id] = fn;
      return fn;
    }

  }

  /**
   * 获取bind函数
   * @param fn
   * @returns {*}
   */
  getBindFunction(id) {
    return this.fns[id];
  }


}
